package org.example;

import javax.swing.*;
import java.awt.*;

/**
 * @author cc
 * @date 2021/4/16 18:56
 * @Description
 */

public class Drawtanke extends JPanel {
    @Override
    public void paint(Graphics g) {
        super.paint(g);
        g.setColor(Color.blue);
        g.drawRect(10,10,20,30);//主体
        g.drawOval(18,25,5,5);//炮台
        g.drawRect(5,8,5,50);//履带
        g.drawRect(30,8,5,50);//履带
        g.drawLine(18,25,18,5);//炮管
        Image image = Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/boom1.png"));
        g.drawImage(image,0,0,60,60,this);
//        System.err.println(Panel.class.getResource("/boom1.png"));
    }
}
